//
//  Node.m
//  TreeTableView
//
//  Created by yixiang on 15/7/3.
//  Copyright (c) 2015年 yixiang. All rights reserved.
//

#import "Node.h"

@implementation Node

- (instancetype)initWithParentId : (int)parentId nodeId : (int)nodeId name : (NSString *)name depth : (int)depth expand : (BOOL)expand :(NSString *)guid{
    self = [self init];
    if (self) {
        self.parentId = parentId;
        self.nodeId = nodeId;
        self.name = name;
        self.depth = depth;
        self.expand = expand;
        self.guid  = guid;
    }
    return self;
}

-(instancetype)initWithPointDic:(NSDictionary *)pointDic{
    self = [super init];
    if (self) {
        _name = [pointDic valueForKey:@"depName"];
        _guid = [pointDic valueForKey:@"depGUID"];
        _nodeSonArray = [pointDic valueForKey:@"children"];
        _expand = NO;
        if ([pointDic valueForKey:@"children"]) {
            _nodeSon = @"1";
        }
        else{
            _nodeSon = @"0";
        }
        
    }
    return self;
}

@end
